package view.graph
{
	import mx.collections.ArrayCollection;

	public class GraphQualityValue extends CustomLineChart
	{
		
		private var _seriseFieldName:Array = ["rvalue_ref","rvalue"];
		private var _seriseDisPlayName:Array = ["R값(지난주)","R값"];
		private var _strokeArray:Array 			= [0x00baff,0xff0037];
		public function GraphQualityValue()
		{
			zeroView = true;
			legendWidth = 134;
			super();
		}
		override public function get seriseFieldName():Array
		{
			return _seriseFieldName;
		}
		override public function get seriseDisPlayName():Array
		{
			return _seriseDisPlayName;
		}
		override public function get strokeArray():Array
		{
			return _strokeArray;
		}
		override protected function getFixed(value:Number):String
		{
			return value.toFixed(2);
		}
		override public function setGraphData($data:*):void
		{
			if(graphData)
				graphData.removeAll();
			graphData= new ArrayCollection();
			var c:int = 0;
			
			_data = $data;
			
		
			
			if(_data.hasOwnProperty("ho"))
				c = _data.ho.time.length;
			
			maxValue = 100;
			for(var i:int = 0;i<c;i++)
			{
				//_seriseFieldName[i]	
				//var obj:Object = getGraphObject(i);
				maxValue = setMaxValue(maxValue,_data.ho.rvalue[i] ,_data.ho_ref.rvalue[i])
				
				var obj:Object = {
					rvalue		: _data.ho.rvalue[i]
						,	rvalue_ref	: _data.ho_ref.rvalue[i]
						,	time		: _data.ho.time[i]
				}; 
				graphData.addItem(obj)
			}
			drawGraph();
		}
	}
}